<?php

namespace Common\Context;


use Hyperf\WebSocketServer\Context;

class WebsocketContext extends Context
{

    const SERVER = 'websocket.server';

    const FRAME = 'websocket.frame';

    const CONTENT = 'websocket.frame.data';

    const PROJECT_ID = 'websocket.project';

    const USER_INFO = 'websocket.userInfo';

    const MEMBER_ID = 'websocket.member_id';

    const MEMBER = 'websocket.member';

    public static function setUserInfo($userInfo): void
    {
        self::set(self::USER_INFO, $userInfo);
    }

    public static function setMember($member): void
    {
        self::set(self::MEMBER, $member);
    }

    public static function setMemberId($member_id): void
    {
        self::set(self::MEMBER_ID, $member_id);
    }


    public static function setProjectId($project_id): void
    {
        self::set(self::PROJECT_ID, $project_id);
    }

    public static function setFd($content): void
    {
        self::set(self::FD, $content);
    }

    public static function setServer($content): void
    {
        self::set(self::SERVER, $content);
    }

    public static function setContent($content): void
    {
        self::set(self::CONTENT, $content);
    }

    public static function setFrame($content): void
    {
        self::set(self::FRAME, $content);
    }

    public static function getContext($key)
    {
        return self::get($key);
    }
}